package com.xncoding.pos.common.model;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;

@Api("分页查询")
@Data
public class AbstractPageQuery {

    @Min(value = 1, message = "请求页码不能小于1")
    @ApiModelProperty(value = "请求页码-默认1，从1开始", required = true,example = "1")
    private int pageNo = 1;

    @Min(value = 1, message = "分页条数应该大于1条")
    @Max(value = 100, message = "分页条数应该小于100条")
    @ApiModelProperty(value = "每页条数-默认20，最大100", required = true,example = "10")
    private int pageSize = 20;

    public AbstractPageQuery() {
    }

    public AbstractPageQuery(int pageNo, int pageSize) {
        this.pageNo = pageNo;
        this.pageSize = pageSize;
    }

}
